package org.utils.util;

import java.io.PrintStream;
import java.util.Enumeration;

import org.apache.log4j.Logger;

/**
 * @author Manuel EVENO
 */
public class DebugUtils
{
	/**
	 * Constructor for DebugUtils.
	 */
	private DebugUtils()
	{
		super();
	}
	
	public static void showEnv()
	{
		showEnv(System.out);
	}
	
	public static void showEnv(Logger c, PrintStream out)
	{
		Enumeration enumList = System.getProperties().keys();
		while (enumList.hasMoreElements())
		{
			String key = (String) enumList.nextElement();
			c.debug(key+'='+System.getProperty(key)+System.getProperty("line.separator"));
		}
	}
	
	public static void showEnv(PrintStream out)
	{
		Enumeration enumList = System.getProperties().keys();
		while (enumList.hasMoreElements())
		{
			String key = (String) enumList.nextElement();
			out.println(key+'='+System.getProperty(key));
		}
	}
}
